package com.woyou.bean;

/**
 * Option类型说明
 * 
 * @author 荣
 * 
 */
public class Option extends SuperBean{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 属性ID
	 */
	private String optId;
	/**
	 * 属性名称
	 */
	private String optName;
	/**
	 * 增加费用
	 */
	private float price;
	/**
	 * 规格组要显示的费用
	 */
	private float specPrice;
	/**
	 * 缺货标志（1正常，0暂缺）
	 */
	private int state;

	/**
	 * 是否被选中
	 */
	private boolean isChecked = false;
	/**
	 * 是否规格组
	 */
	private boolean isSpec = false;
	/**
	 * 父组
	 */
	private OptionGroup parent;
	
	public float getSpecPrice() {
		return specPrice;
	}

	public void setSpecPrice(float specPrice) {
		this.specPrice = specPrice;
	}

	public OptionGroup getParent() {
		return parent;
	}

	public void setParent(OptionGroup parent) {
		this.parent = parent;
	}

	public boolean isSpec() {
		return isSpec;
	}

	public void setSpec(boolean isSpec) {
		this.isSpec = isSpec;
	}

	public String getOptId() {
		return optId;
	}

	public void setOptId(String optId) {
		this.optId = optId;
	}

	public String getOptName() {
		return optName;
	}

	public void setOptName(String optName) {
		this.optName = optName;
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public boolean isChecked() {
		return isChecked;
	}

	public void setChecked(boolean isChecked) {
		this.isChecked = isChecked;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((optId == null) ? 0 : optId.hashCode());
		result = prime * result + ((optName == null) ? 0 : optName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Option other = (Option) obj;
		if (optId == null) {
			if (other.optId != null)
				return false;
		} else if (!optId.equals(other.optId))
			return false;
		if (optName == null) {
			if (other.optName != null)
				return false;
		} else if (!optName.equals(other.optName))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Option [optId=" + optId + ", optName=" + optName + "]";
	}

	
	

}
